package com.kefu.boss.mapper;

import com.kefu.boss.model.BossMenu;
import com.kefu.common.mybatis.KefuMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BossMenuMapper extends KefuMapper<BossMenu> {
    @Select("SELECT t1.* from boss_menu t1,boss_role_menu t2 where t1.id = t2.menu_id and t1.data_status = 1 and t2.role_id = #{arg0}")
    List<BossMenu> getMenuByRoleId(String roleId);

    @Select("select COALESCE(max(weight),0) from boss_menu where parent_id = #{arg0}")
    Integer getMaxWeight(String parentId);
}
